package org.siam.utils {
	
	import mx.core.ClassFactory;

	public class UIComponentFactory extends ClassFactory {
		
		public var styles:Object = null;
		
		public function UIComponentFactory(generator:Class=null, styles:Object=null) {
			super(generator);
			
			this.styles = styles;
		}
		
		override public function newInstance():* {
			var instance:Object = super.newInstance();
	        if (styles) {
        		for (var style:String in styles) {
        			instance.setStyle(style, styles[style]);
				}
       		}
	       	return instance;
		}
	}
}